package com.wuxiaofan.ware.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.ware.entity.WareOrderTask;
import com.wuxiaofan.ware.entity.custom.WareOrderTaskCustom;
import com.wuxiaofan.ware.mapper.WareOrderTaskMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.ware.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class WareOrderTaskService {
    @Autowired
    private WareOrderTaskMapper wmsWareOrderTaskMapper;
    @Resource
    private Idgenerator idgenerator;
    public WareOrderTask findById(String id){
        return wmsWareOrderTaskMapper.selectById(id);
    }

    public WareOrderTaskCustom findCountByMap(Map paraMap){
        return wmsWareOrderTaskMapper.findCountByMap(paraMap);
    }

    public WareOrderTaskCustom findGroupByMap(Map paraMap){
        return wmsWareOrderTaskMapper.findGroupByMap(paraMap);
    }

    public List<WareOrderTaskCustom> findByMap(Map paraMap){
        return wmsWareOrderTaskMapper.findByMap(paraMap);
    }

    public Page<WareOrderTaskCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(wmsWareOrderTaskMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        wmsWareOrderTaskMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        wmsWareOrderTaskMapper.deleteById(id);
    }

    public WareOrderTask save(WareOrderTask wmsWareOrderTask){
        wmsWareOrderTask.setId(idgenerator.getId());
        wmsWareOrderTaskMapper.insert(wmsWareOrderTask);
        return wmsWareOrderTask;
    }

}
